package com.lyw.dao;

import com.lyw.pojo.House;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

public interface HouseDao extends JpaRepository<House,Long> {
    @Query(value = "select * from room_house where name like ?1",nativeQuery = true,
    countQuery = "select count(*) from (select * from room_house where name like ?1)abc")
    Page<Map<String, Object>> findList(String s, Pageable of);

    @Query(value = "select * from room_house where status = 0",nativeQuery = true)
    List<House> mai();

    @Query(value = "select * from room_house where status = 1",nativeQuery = true)
    List<House> zu();

    @Query(value = "select * from room_house where status = 2",nativeQuery = true)
    List<House> two();
}
